/**
 * <p><b>Title:</b> AuthorFilter.java </p>
 * @Package com.wondertek.oes.charge.service.manager.rule.filter
 */
package com.wondertek.poms.core.filter.impl;

import com.wondertek.poms.core.filter.BaseRuleFilter;
import com.wondertek.poms.core.filter.RuleFilterChain;
import com.wondertek.poms.dao.po.Content;
import com.wondertek.poms.dao.po.DefaultPrdSal;
import com.wondertek.poms.dao.po.IRulePo;
import com.wondertek.poms.dao.po.PrdInfoRule;

/**
 * <p><b>AuthorFilter Description:</b> 剧集类型匹配规则</p>
 * @author douzi
 * <b>DATE</b> 2019年8月30日 下午2:28:13
 */
public class FormTypeFilter extends BaseRuleFilter {

	@Override
	public void doFilter(IRulePo rule, Content c, RuleFilterChain chain) {
		if (rule instanceof PrdInfoRule) {
			PrdInfoRule r = (PrdInfoRule) rule;
			this.baseFilter(r.getPrdRuleId(), 
					r.getFormType() == null ? null : r.getFormType() + "",
					c.getFormType(), 
					chain, 
					"剧集类型-FormType");
		} else if (rule instanceof DefaultPrdSal) {
			DefaultPrdSal r = (DefaultPrdSal) rule;
			this.baseFilter(r.getId(), 
					r.getFormType() == null ? null : r.getFormType() + "",
					c.getFormType(), 
					chain, 
					"剧集类型-FormType");
		}
		chain.doFilter(rule, c, chain);
	}

}
